package com.atguigu.adddemo;

public class MainMethod {

    public static void main(String[] args) {
        NumberClass numberClass = new NumberClass();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    numberClass.add();
                }
            }
        }, "aaa").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    numberClass.sub();
                }
            }
        }, "bbb").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    numberClass.add();
                }
            }
        }, "aaa1").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    numberClass.sub();
                }
            }
        }, "bbb1").start();
    }

}
